<%@page import="org.springframework.security.core.context.SecurityContextHolder"%>
<%@page import="org.apache.commons.lang.StringUtils"%>
<%@page import="org.apache.commons.lang.time.DateFormatUtils"%>
<%@page import="org.springframework.util.CollectionUtils"%>
<%@page import="java.util.Collection"%>
<%@ include file="../common/common_include.jsp"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<%
	TblOaNotice coreNotice =  (TblOaNotice)request.getAttribute("coreNotice");
	NoticeForm form = (NoticeForm)request.getAttribute("command");
	String title = StringUtils.isNotBlank(coreNotice.getTitle())?coreNotice.getTitle():"";
	String viceTitle = StringUtils.isNotBlank(coreNotice.getViceTitle())?coreNotice.getViceTitle():"";
	String content = StringUtils.isNotBlank(coreNotice.getContent())?coreNotice.getContent():"";
	String publicTime = (null!=coreNotice.getPublicTime())?DateFormatUtils.format(coreNotice.getPublicTime().getTime(), "yyyy-MM-dd HH:mm:ss"):"";
	String group = "0";
	
	String sendTo = StringUtils.isNotBlank(coreNotice.getSendto())?coreNotice.getSendto():"";
	String copyTo = StringUtils.isNotBlank(coreNotice.getCopyto())?coreNotice.getCopyto():"";
	String publicDepart = StringUtils.isNotBlank(coreNotice.getPublicDepart())?coreNotice.getPublicDepart():"";
	
	String docNumber = StringUtils.isNotBlank(coreNotice.getDocNumber())?coreNotice.getDocNumber():"";
	String publicMan = StringUtils.isNotBlank(coreNotice.getPublicMan())?coreNotice.getPublicMan():"";
	String siteName = StringUtils.isNotBlank(coreNotice.getSiteName())?coreNotice.getSiteName():"";
	
	String prevId = "";
	String prevTitle = "没有了";
	String nextId = "";
	String nextTitle = "没有了";
	if(null!=request.getAttribute("prev")){
		TblOaNotice prev = (TblOaNotice)request.getAttribute("prev");
		prevId = EncrypTool.encode(prev.getNoticeId()+"");
		prevTitle = prev.getTitle();
	}
	if(null!=request.getAttribute("next")){
		TblOaNotice next = (TblOaNotice)request.getAttribute("next");
		nextId = EncrypTool.encode(next.getNoticeId()+"");
		nextTitle = next.getTitle();
	}
	
%>
<div class="main">
	<div class="breadcrumb">
		<div class="bcIcon"></div>
		<ul class="bcNav">
			<li><a href="javascript:XF.Notice.listNotice('0','',1)">内部公告</a>
				<span class="divider">&rsaquo;</span></li>
			<li>详细信息</li>
		</ul>
	</div>

	<div class="container" id="printPannel">
	<div class="printTop toprint"><span class="right size">www.xf-express.com.cn</span><span class="img"><img src="images/print_top_logo.jpg" width="209" height="30" /></span></div>
		<div class="noticeFormatter">
			<div class="titleBox">
		         <p class="mainTitle" name="top"><%=title%></p>
		         <p class="viceTitle"><%=viceTitle%></p>
		         <p class="secondTitle">文件编号：【<%=docNumber%>】</p>
		         <p class="secondTitle">发布时间：<%=publicTime %>&nbsp;&nbsp;发布人：<%=publicMan%>
		         </p>
		     </div>
		     <div class="section">
		        <p><%=content %></p>                
		    </div>
		    	
		    <%
		    	if(coreNotice.getNoticeGroup().equalsIgnoreCase(Constants.NOTICE_GROUP_NOTICE)){
		    		%>
		    		<div class="notice-detail-bold">
				        <div class="notice-detail-bold-item">
							<label>主送：<%=sendTo %></label>	        
				        </div>
				        <div class="notice-detail-bold-item">
							<label>抄送：<%=copyTo %></label>	        
				        </div>
				        <div class="notice-detail-bold-item">
							<label>发文：<%=publicDepart %></label>	        
				        </div>
				    </div>
		    		<%
		    	}
		    %>

		    <div class="clear">&nbsp;</div>
		    <div class="notice-linWrap noprint">
		    	<div>
		    		<label>上一条：</label>
		    			<%
		    				if(StringUtils.isNotBlank(prevId)){
		    					%>
		    						<a href="javascript:XF.Notice.detail('<%=prevId %>','','<%=form.getPageNum()%>','<%=group%>')"><%=prevTitle %></a>
		    					<%
		    				}else{
								%>
		    						<a href="javascript:void(0)"><%=prevTitle %></a>
		    					<%
		    				}
		    			%>
		    	</div>
		    	<div>
		    		<label>下一条：</label>
		    			<%
		    				if(StringUtils.isNotBlank(nextId)){
		    					%>
		    						<a href="javascript:XF.Notice.detail('<%=nextId %>','','<%=form.getPageNum()%>','<%=group%>')"><%=nextTitle %></a>
		    					<%
		    				}else{
								%>
		    						<a href="javascript:void(0)"><%=nextTitle %></a>
		    					<%
		    				}
		    			%>
		    	</div>
		    </div>
	    </div>
	</div>
<%-- 	<div class="printBtnWrap">
		<a target="_blank" href="<%=request.getContextPath()%>/notice/preview?noticeId=<%=coreNotice.getNoticeId()%>" class="a-btn-microsoft">打印</a>
	</div> --%>
		<div class="printBtnWrap">
		<a  href="javascript:XF.Notice.noticeBack('<%=form.getGroup() %>','<%=form.getPageNum() %>','<%=form.getTitle() %>')" class="a-btn-microsoft">返回</a>
		<a  href="javascript:onClickPrint()" class="a-btn-microsoft">打印</a>
	</div>
</div>



